<template>
  <div class="goods">
     <h3>商品名称：{{ pname }}</h3>
    <p>商品单价：{{ price }}</p>
    <p>商品介绍：{{ info }}</p>
    <button @click="$emit('kanyidao',id)">砍一刀</button>
  </div>
</template>

<script>
export default {
    // props:['id','pname','price','info']
    props: {
        id: {
            required:true,
            type:Number
        },
        pname:{
            default:'方便面'
        },
        price: Number,
        info: {
            default:'非常好吃，好香'
        }
    }
}
</script>

<style>
.goods {
    padding: 10px;
    margin: 8px;
    border: 3px solid #000;
    min-height: 50px;
}
</style>